@using Unity.ClusterDisplay.MissionControl.MissionControl;

<RadzenTemplateForm TItem="SaveMissionCommand" Data=@Command Submit=@OnOk Style="height: 100%">
    <RadzenStack Orientation="Orientation.Vertical" JustifyContent="JustifyContent.SpaceBetween" Style="height: 100%">
        <RadzenStack Orientation="Orientation.Vertical">
            @if (Overwritables.Any())
            {
                <RadzenLabel Text="Snapshot" />
                <RadzenDropDownDataGrid Name="Snapshot" @bind-Value=@m_SelectedForOverwrite
                                    Data="@Overwritables" TextProperty="Description.Name"
                                    FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
                                    Change="@(args => OverwriteSelectionChanged())">
                    <Columns>
                        <RadzenDropDownDataGridColumn Property="Description.Name" Title="Snapshot" />
                    </Columns>
                </RadzenDropDownDataGrid>
            }
            <RadzenLabel Text="Name" />
            <RadzenTextBox Name="MissionName" @bind-Value=@Command.Description.Name />
            <RadzenRequiredValidator Component="MissionName" Text="Name is required" />
            <RadzenLabel Text="Description" />
            <RadzenTextArea @bind-Value=@Command.Description.Details />

        </RadzenStack>
        <RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.End" class="text-end">
            <RadzenButton Text="Cancel" Click=OnCancel ButtonStyle="ButtonStyle.Light" Style="width: 120px" />
            <RadzenButton Text="@SaveButtonText" ButtonType="ButtonType.Submit" ButtonStyle="ButtonStyle.Info" Style="width: 120px" Class="me-1" />
        </RadzenStack>
    </RadzenStack>
</RadzenTemplateForm>
